package com.saint.lt.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.saint.lt.dao.UserDAO;
import com.saint.lt.domain.User;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserDAO userDAO;

	@Override
	@Transactional
	public void addUser(User user) {
		userDAO.add(user);
	}

	@Override
	@Transactional
	public void removeUser(User user) {
		userDAO.remove(user);
	}

	@Override
	@Transactional
	public void removeUser(String username) {
		userDAO.remove(username);
	}

	@Override
	@Transactional
	public List<User> listUsers() {
		return userDAO.list();
	}

	@Override
	@Transactional
	public User get(String username) {
		return userDAO.get(username);
	}

}
